
let surgerying=sessionStorage.getItem("surgerying");
let eventList=sessionStorage.getItem("surgerying-eventList");
const useSurgeryingStore = defineStore(
  'surgerying',
  {
    state: () => ({
      surgerying: surgerying?JSON.parse(surgerying):{},
      editingSurgery:[],
      eventList:eventList?JSON.parse(eventList):[]
    }),
    actions: {
      //获取当前手术
      setEventList(value) {
        sessionStorage.setItem("surgerying-eventList",JSON.stringify(value));
        this.eventList=value
      },
      // 设置当前手术
      setSurgerying( value) {
        sessionStorage.setItem("surgerying",JSON.stringify(value));
        this.surgerying=value
      },
      //获取当前编辑事件
      getEditingSurgery() {
        return this.editingSurgery
      },
      // 设置当前编辑事件
      setEditingSurgery( value) {
        this.editingSurgery=value
      }
    }
  })

export default useSurgeryingStore
